<template>
	<view class="content">
		<text style="font-size: 50rpx;">子组件A</text>
		<view class="coma_box">
			<text>父组件进来的值：</text>
			<text style="font-weight: bold;color: red;">{{intent}}</text>
		</view>
		<button style="margin: 0 0 50rpx;" type="primary" @click="sendData()">传值给CompB</button>
	</view>
</template> 

<script>
	export default {
		props: ['intent'],
		data() {
			return {
			};
		},
		methods: {
			sendData() {
				console.warn("----CompA----sendData------>" + this.intent);
				uni.$emit('getIntent', this.intent);
			}
		}
	}
</script>

<style>
	.content {
		margin: 20rpx 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		background-color: orange;
	}
	.coma_box{
		width: 100%;
		margin: 30rpx;
	}
</style>